from django.contrib import admin
from .models import Author, Blog


# Register your models here.

# admin.site.register(Author)

# 第二种注册方式
@admin.register(Author)
class AuthorAdmin(admin.ModelAdmin):
    # pass
    # list_display = ["name", 'birthday'] # 展示列表
    # fields = ['name']  # 配置添加和修改属性

    # list_per_page = 2  # 类似于分页

    list_filter = ['name', 'birthday']

    ordering = ['-birthday', 'name']  # 排序


# 第一种注册方式
# admin.site.register(Author, AuthorAdmin)

class BlogAdmin(admin.ModelAdmin):
    pass


admin.site.register(Blog, BlogAdmin)
